/**
 * Created by Dalyn on 2017/3/28.
 */
import Relay from "react-relay";

export default class DeleteGoodsMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { deleteGoods }`;
    }

    getVariables() {
        return {
            argsInput: {
                ids: this.props.ids,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on deleteGoodsPayload {
            responseData {  
                errorCode
                value
                totalResult
                id
                goodsProperty
                companyList
                goodsInfoDescModel{
                    goodsId
                }
                goodsInfoDescModelList{
                   
                    goodsId
                    
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on deleteGoodsPayload {
                    responseData {
                        errorCode
                        value
                        totalResult
                        id
                        goodsProperty
                        companyList
                        goodsInfoDescModel{
                            goodsId
                        }
                        goodsInfoDescModelList{
                            goodsId   
                        }
                                                
                    }
                }
            `]
        }];
    }

}